/**
 * <b>项目名：</b>hclv-web<br/>  
 * <b>包名：</b>com.flea.hclv.util<br/>  
 * <b>文件名：</b>HclvDictUtil.java<br/>  
 * <b>版本信息：</b>1.0<br/>  
 * <b>日期：</b>2018年9月15日 下午8:42:03<br/>  
 * <b>COPYRIGHT 2010-2012 ALL RIGHTS RESERVED 虫子科技</b>-版权所有<br/>
 */
package com.flea.hclv.util;

import com.flea.hclv.constant.HConstant;
import com.flea.system.entity.OrgDept;
import com.flea.system.entity.WebDict;
import com.flea.system.platform.session.FleaOrgUtils;
import com.flea.system.service.IDictService;
import com.flea.system.utils.FleaWordServiceUtils;

import java.util.List;
import java.util.Map;

/**
 * @description
 * @createTime 2018年9月15日 下午8:42:03
 * @modifyTime
 * @author myflea@163.com
 * @version 1.0
 */
public final class HclvDictUtil {

	public static List<WebDict> getProvinces() {

		Map<String, Object> result = FleaWordServiceUtils.classService("dictService", IDictService.class, "findByPCode",
				HConstant.HCLV_PROVINCE_PCODE);
		if (null != result) {
			@SuppressWarnings("unchecked")
			List<WebDict> pros = (List<WebDict>) result.get("model");

			return pros;

		} else {
			return null;
		}
	}

	public static List<WebDict> getCity(String provinceCode) {

		Map<String, Object> result = FleaWordServiceUtils.classService("dictService", IDictService.class, "findByPCode",
				provinceCode);
		if (null != result) {
			@SuppressWarnings("unchecked")
			List<WebDict> citys = (List<WebDict>) result.get("model");

			return citys;

		} else {
			return null;
		}

	}

	public static List<WebDict> getZones(String provinceCode) {

		Map<String, Object> result = FleaWordServiceUtils.classService("dictService", IDictService.class, "findByPCode",
				provinceCode);
		if (null != result) {
			@SuppressWarnings("unchecked")
			List<WebDict> zones = (List<WebDict>) result.get("model");

			return zones;

		} else {
			return null;
		}

	}
	//通过code获取字典名称
	public static WebDict getCodeName(String code,String type) {

		Map<String, Object> result = FleaWordServiceUtils.classService("dictService", IDictService.class, "findByDictCodeAndType",
				code,type);
		if (null != result) {
			@SuppressWarnings("unchecked")
			WebDict dict = (WebDict) result.get("model");

			return dict;

		} else {
			return null;
		}

	}
	//旅游类别
	public static List<WebDict> getTourism() {

		Map<String, Object> result = FleaWordServiceUtils.classService("dictService", IDictService.class, "findByPCode",
				HConstant.HCLV_TOURISM_PCODE);
		if (null != result) {
			@SuppressWarnings("unchecked")
			List<WebDict> pros = (List<WebDict>) result.get("model");
			return pros;
		} else {
			return null;
		}
	}
	//行程类型
	public static List<WebDict> getTrip() {

		Map<String, Object> result = FleaWordServiceUtils.classService("dictService", IDictService.class, "findByPCode",
				HConstant.HCLV_TRIP_PCODE);
		if (null != result) {
			@SuppressWarnings("unchecked")
			List<WebDict> pros = (List<WebDict>) result.get("model");
			return pros;
		} else {
			return null;
		}
	}
	//说明表 类型
	public static List<WebDict> getExplain() {

		Map<String, Object> result = FleaWordServiceUtils.classService("dictService", IDictService.class, "findByPCode",
				HConstant.HCLV_EXPLAIN_PCODE);
		if (null != result) {
			@SuppressWarnings("unchecked")
			List<WebDict> pros = (List<WebDict>) result.get("model");
			return pros;
		} else {
			return null;
		}
	}
	//车辆类型
	public static List<WebDict> getVehicle() {
		Map<String, Object> result = FleaWordServiceUtils.classService("dictService", IDictService.class, "findByPCode",
				HConstant.HCLV_VEHICLE_PCODE);
		if (null != result) {
			@SuppressWarnings("unchecked")
			List<WebDict> pros = (List<WebDict>) result.get("model");
			return pros;
		} else {
			return null;
		}
	}
	//准驾车型
	public static List<WebDict> getDrivingModel() {
		Map<String, Object> result = FleaWordServiceUtils.classService("dictService", IDictService.class, "findByPCode",
				HConstant.HCLV_DRIVING_MODEL_PCODE);
		if (null != result) {
			@SuppressWarnings("unchecked")
			List<WebDict> pros = (List<WebDict>) result.get("model");
			return pros;
		} else {
			return null;
		}
	}
	//证件类型
	public static List<WebDict> getCertificates() {
		Map<String, Object> result = FleaWordServiceUtils.classService("dictService", IDictService.class, "findByPCode",
				HConstant.HCLV_CERTIFICATES_PCODE);
		if (null != result) {
			@SuppressWarnings("unchecked")
			List<WebDict> pros = (List<WebDict>) result.get("model");
			return pros;
		} else {
			return null;
		}
	}
	//产品销售状态
	public static List<WebDict> getProductSaleStatus() {
		Map<String, Object> result = FleaWordServiceUtils.classService("dictService", IDictService.class, "findByPCode",
				HConstant.HCLV_PRODUCT_SALE_STATUS_PCODE);
		if (null != result) {
			@SuppressWarnings("unchecked")
			List<WebDict> pros = (List<WebDict>) result.get("model");
			return pros;
		} else {
			return null;
		}
	}
	//获取游客旅游团状态
	public static List<WebDict> getTravelGroupStatus() {
		Map<String, Object> result = FleaWordServiceUtils.classService("dictService", IDictService.class, "findByPCode",
				HConstant.HCLV_VISIROR_GROUP_STATUS);
		if (null != result) {
			@SuppressWarnings("unchecked")
			List<WebDict> pros = (List<WebDict>) result.get("model");
			return pros;
		} else {
			return null;
		}
	}
	//获取支付类型
	public static List<WebDict> getPayType() {
		Map<String, Object> result = FleaWordServiceUtils.classService("dictService", IDictService.class, "findByPCode",
				HConstant.D_PAY_TYPE);
		if (null != result) {
			@SuppressWarnings("unchecked")
			List<WebDict> pros = (List<WebDict>) result.get("model");
			return pros;
		} else {
			return null;
		}
	}
	//获取游客订单状态
	public static List<WebDict> getVisitorOderStatus() {
		Map<String, Object> result = FleaWordServiceUtils.classService("dictService", IDictService.class, "findByPCode",
				HConstant.D_HCLV_D_ORDER_STATUS);
		if (null != result) {
			@SuppressWarnings("unchecked")
			List<WebDict> pros = (List<WebDict>) result.get("model");
			return pros;
		} else {
			return null;
		}
	}
	//获取游客类型
	public static List<WebDict> getVisitorType() {
		Map<String, Object> result = FleaWordServiceUtils.classService("dictService", IDictService.class, "findByPCode",
				HConstant.D_VISITOR_TYPE);
		if (null != result) {
			@SuppressWarnings("unchecked")
			List<WebDict> pros = (List<WebDict>) result.get("model");
			return pros;
		} else {
			return null;
		}
	}
	//缴费状态
    public static List<WebDict> getCustomerStatus() {
		Map<String, Object> result = FleaWordServiceUtils.classService("dictService", IDictService.class, "findByPCode",
				HConstant.D_CUSTOMER_STATUS);
		if (null != result) {
			@SuppressWarnings("unchecked")
			List<WebDict> pros = (List<WebDict>) result.get("model");
			return pros;
		} else {
			return null;
		}
    }
    //获取组团社和供应商之间的订单状态
    public static List<WebDict> getServiceOrgderStatus() {
    	Map<String, Object> result = FleaWordServiceUtils.classService("dictService", IDictService.class, "findByPCode",
    			HConstant.D_HCLV_D_SERVICE_ORDER_STATIC);
    	if (null != result) {
    		@SuppressWarnings("unchecked")
    		List<WebDict> pros = (List<WebDict>) result.get("model");
    		return pros;
    	} else {
    		return null;
    	}
    }
    //获取更新订单申请状态
    public static List<WebDict> getUpdateSerivcOrderUpdateApplyStatus() {
    	Map<String, Object> result = FleaWordServiceUtils.classService("dictService", IDictService.class, "findByPCode",
    			HConstant.D_HCLV_D_SERVICE_ORDER_UPDATE_ALLPY_STATE);
    	if (null != result) {
    		@SuppressWarnings("unchecked")
    		List<WebDict> pros = (List<WebDict>) result.get("model");
    		return pros;
    	} else {
    		return null;
    	}
    }
    public static String coverOrgCodeToName(String orgDeptId){
      OrgDept result = FleaOrgUtils.getOrgDeptByDeptUuid(orgDeptId);
      String orgDepName = null;
      if(null!=result){
        orgDepName = result.getDeptName();
      }else{
        orgDepName = HConstant.HCLV_ROOT_ORGDEPT;
      }
	    return orgDepName;
    }

    public static List<WebDict> getGuideAuditStatus() {
		Map<String, Object> result = FleaWordServiceUtils.classService("dictService", IDictService.class, "findByPCode",
				HConstant.D_AUDIT_STATUS);
		if (null != result) {
			@SuppressWarnings("unchecked")
			List<WebDict> pros = (List<WebDict>) result.get("model");
			return pros;
		} else {
			return null;
		}
    }

	public static List<WebDict> getGuidePayStatus() {
		Map<String, Object> result = FleaWordServiceUtils.classService("dictService", IDictService.class, "findByPCode",
				HConstant.D_GUIDE_PAY_STATUS);
		if (null != result) {
			@SuppressWarnings("unchecked")
			List<WebDict> pros = (List<WebDict>) result.get("model");
			return pros;
		} else {
			return null;
		}
	}
	public static List<WebDict> getServiceOrgType() {
		Map<String, Object> result = FleaWordServiceUtils.classService("dictService", IDictService.class, "findByPCode",
				HConstant.D_SERVICE_ORG_TYPE);
		if (null != result) {
			@SuppressWarnings("unchecked")
			List<WebDict> pros = (List<WebDict>) result.get("model");
			return pros;
		} else {
			return null;
		}
	}

  /**
   * 服务订单修改类型
   * @return
   */
	public static List<WebDict> getServiceApplyType() {
		Map<String, Object> result = FleaWordServiceUtils.classService("dictService", IDictService.class, "findByPCode",
				HConstant.D_HCLV_D_SERVICE_ORDER_UPDATE_ALLPY_TYPE);
		if (null != result) {
			@SuppressWarnings("unchecked")
			List<WebDict> pros = (List<WebDict>) result.get("model");
			return pros;
		} else {
			return null;
		}
	}

	public static List<WebDict> getCarReserveStatus() {
		Map<String, Object> result = FleaWordServiceUtils.classService("dictService", IDictService.class, "findByPCode",
				HConstant.D_CAR_RESERVE_STATUS);
		if (null != result) {
			@SuppressWarnings("unchecked")
			List<WebDict> pros = (List<WebDict>) result.get("model");
			return pros;
		} else {
			return null;
		}
	}

	public static List<WebDict> getCarReservePayStatus() {
		Map<String, Object> result = FleaWordServiceUtils.classService("dictService", IDictService.class, "findByPCode",
				HConstant.D_CAR_PAY_STATUS);
		if (null != result) {
			@SuppressWarnings("unchecked")
			List<WebDict> pros = (List<WebDict>) result.get("model");
			return pros;
		} else {
			return null;
		}
	}

    public static List<WebDict> getCarReserveApplyStatus() {
		Map<String, Object> result = FleaWordServiceUtils.classService("dictService", IDictService.class, "findByPCode",
				HConstant.D_CAR_REVERCE_APPLY);
		if (null != result) {
			@SuppressWarnings("unchecked")
			List<WebDict> pros = (List<WebDict>) result.get("model");
			return pros;
		} else {
			return null;
		}
    }
    public static List<WebDict> getHTProjectList() {
    	Map<String, Object> result = FleaWordServiceUtils.classService("dictService", IDictService.class, "findByPCode",
    			HConstant.D_HT_DITIE_PROJECT);
    	if (null != result) {
    		@SuppressWarnings("unchecked")
    		List<WebDict> pros = (List<WebDict>) result.get("model");
    		return pros;
    	} else {
    		return null;
    	}
    }

	public static List<WebDict> getDictWorkType() {
	  	Map<String, Object> result = FleaWordServiceUtils.classService("dictService", IDictService.class, "findByPCode",
    			HConstant.D_HT_DITIE_WORK_TYPE);
    	if (null != result) {
    		@SuppressWarnings("unchecked")
    		List<WebDict> pros = (List<WebDict>) result.get("model");
    		return pros;
    	} else {
    		return null;
    	}
	}

	public static List<WebDict> getFaceRoleType() {
	  	Map<String, Object> result = FleaWordServiceUtils.classService("dictService", IDictService.class, "findByPCode",
    			HConstant.D_HT_DITIE_ROLE);
    	if (null != result) {
    		@SuppressWarnings("unchecked")
    		List<WebDict> pros = (List<WebDict>) result.get("model");
    		return pros;
    	} else {
    		return null;
    	}
	}
	public static List<WebDict> getTeams() {
		Map<String, Object> result = FleaWordServiceUtils.classService("dictService", IDictService.class, "findByPCode",
				HConstant.D_HT_DITIE_TEAM);
		if (null != result) {
			@SuppressWarnings("unchecked")
			List<WebDict> pros = (List<WebDict>) result.get("model");
			return pros;
		} else {
			return null;
		}
	}
}
